
import { get, post, del, BASE_URL } from '../utils/request'

module.exports = {
  getPayCategories: function (query) {
    // 获取消费分类
    return get('/expenses/categories/', {}, query)
  },
  createExpense: function (param) {
    // 生成消费
    return post('/expenses/', param)
  },
  getExpenses: function (query) {
    // 获取账单
    return get('/expenses/', {}, query)
  },
  delExpense: function (expense_id) {
    // 删除账单
    return del(`/expenses/${expense_id}/`)
  },
  // 统计指定时间内的消费支出总和
  getStatisticalAggregate: function (query) {
    return get('/expenses/statistical/aggregate/', {}, query)
  },
  getStatisticalDay: function (query) {
    // 根据天 进行统计
    return get('/expenses/statistical/day/', {}, query)
  },
  getStatisticalMonth: function (query) {
    // 根据月 进行统计
    return get('/expenses/statistical/month/', {}, query)
  },
  getStatisticalYear: function (query) {
    // 根据年 进行统计
    return get('/expenses/statistical/year/', {}, query)
  },



}